home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Video.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  31KB  |  739 lines

  1. /*
  2.      File:        Video.h
  3.  
  4.      Contains:    Video Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __VIDEO__
  19. #define __VIDEO__
  20.  
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. #if PRAGMA_IMPORT_SUPPORTED
  30. #pragma import on
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37.  
  38. enum {
  39.     mBaseOffset                    = 1,                            /*Id of mBaseOffset.*/
  40.     mRowBytes                    = 2,                            /*Video sResource parameter Id's */
  41.     mBounds                        = 3,                            /*Video sResource parameter Id's */
  42.     mVersion                    = 4,                            /*Video sResource parameter Id's */
  43.     mHRes                        = 5,                            /*Video sResource parameter Id's */
  44.     mVRes                        = 6,                            /*Video sResource parameter Id's */
  45.     mPixelType                    = 7,                            /*Video sResource parameter Id's */
  46.     mPixelSize                    = 8,                            /*Video sResource parameter Id's */
  47.     mCmpCount                    = 9,                            /*Video sResource parameter Id's */
  48.     mCmpSize                    = 10,                            /*Video sResource parameter Id's */
  49.     mPlaneBytes                    = 11,                            /*Video sResource parameter Id's */
  50.     mVertRefRate                = 14,                            /*Video sResource parameter Id's */
  51.     mVidParams                    = 1,                            /*Video parameter block id.*/
  52.     mTable                        = 2,                            /*Offset to the table.*/
  53.     mPageCnt                    = 3,                            /*Number of pages*/
  54.     mDevType                    = 4,                            /*Device Type*/
  55.     oneBitMode                    = 128,                            /*Id of OneBitMode Parameter list.*/
  56.     twoBitMode                    = 129,                            /*Id of TwoBitMode Parameter list.*/
  57.     fourBitMode                    = 130,                            /*Id of FourBitMode Parameter list.*/
  58.     eightBitMode                = 131                            /*Id of EightBitMode Parameter list.*/
  59. };
  60.  
  61.  
  62. enum {
  63.     sixteenBitMode                = 132,                            /*Id of SixteenBitMode Parameter list.*/
  64.     thirtyTwoBitMode            = 133,                            /*Id of ThirtyTwoBitMode Parameter list.*/
  65.     firstVidMode                = 128,                            /*The new, better way to do the above. */
  66.     secondVidMode                = 129,                            /* QuickDraw only supports six video */
  67.     thirdVidMode                = 130,                            /* at this time.      */
  68.     fourthVidMode                = 131,
  69.     fifthVidMode                = 132,
  70.     sixthVidMode                = 133,
  71.     spGammaDir                    = 64,
  72.     spVidNamesDir                = 65
  73. };
  74.  
  75. /* csTimingFormat values in VDTimingInfo */
  76. /* look in the declaration rom for timing info */
  77.  
  78. enum {
  79.     kDeclROMtables                = 'decl'
  80. };
  81.  
  82. /*
  83.  Timing mode constants for Display Manager MultiMode support
  84.     Corresponding    .h equates are in Video.h
  85.                     .a equates are in Video.a
  86.                     .r equates are in DepVideoEqu.r
  87.     
  88.     The first enum is the old names (for compatibility).
  89.     The second enum is the new names.
  90. */
  91.  
  92. enum {
  93.     timingApple12                = 130,                            /*  512x384 (60 Hz) Rubik timing.*/
  94.     timingApple12x                = 135,                            /*  560x384 (60 Hz) Rubik-560 timing.*/
  95.     timingApple13                = 140,                            /*  640x480 (67 Hz) HR timing.*/
  96.     timingApple13x                = 145,                            /*  640x400 (67 Hz) HR-400 timing.*/
  97.     timingAppleVGA                = 150,                            /*  640x480  (60 Hz) VGA timing.*/
  98.     timingApple15                = 160,                            /*  640x870 (75 Hz) FPD timing.*/
  99.     timingApple15x                = 165,                            /*  640x818 (75 Hz) FPD-818 timing.*/
  100.     timingApple16                = 170,                            /*  832x624 (75 Hz) GoldFish timing.*/
  101.     timingAppleSVGA                = 180,                            /*  800x600  (56 Hz) SVGA timing.*/
  102.     timingApple1Ka                = 190,                            /* 1024x768 (60 Hz) VESA 1K-60Hz timing.*/
  103.     timingApple1Kb                = 200,                            /* 1024x768 (70 Hz) VESA 1K-70Hz timing.*/
  104.     timingApple19                = 210,                            /* 1024x768  (75 Hz) Apple 19" RGB.*/
  105.     timingApple21                = 220                            /* 1152x870  (75 Hz) Apple 21" RGB.*/
  106. };
  107.  
  108.  
  109. enum {
  110.     timingInvalid                = 0,                            /* Unknown timing... force user to confirm.*/
  111.     timingApple_512x384_60hz    = 130,                            /*  512x384  (60 Hz) Rubik timing.*/
  112.     timingApple_560x384_60hz    = 135,                            /*  560x384  (60 Hz) Rubik-560 timing.*/
  113.     timingApple_640x480_67hz    = 140,                            /*  640x480  (67 Hz) HR timing.*/
  114.     timingApple_640x400_67hz    = 145,                            /*  640x400  (67 Hz) HR-400 timing.*/
  115.     timingVESA_640x480_60hz        = 150,                            /*  640x480  (60 Hz) VGA timing.*/
  116.     timingApple_640x870_75hz    = 160,                            /*  640x870  (75 Hz) FPD timing.*/
  117.     timingApple_640x818_75hz    = 165,                            /*  640x818  (75 Hz) FPD-818 timing.*/
  118.     timingApple_832x624_75hz    = 170,                            /*  832x624  (75 Hz) GoldFish timing.*/
  119.     timingVESA_800x600_56hz        = 180,                            /*  800x600  (56 Hz) SVGA timing.*/
  120.     timingVESA_800x600_60hz        = 182,                            /*  800x600  (60 Hz) SVGA timing.*/
  121.     timingVESA_800x600_72hz        = 184,                            /*  800x600  (72 Hz) SVGA timing.*/
  122.     timingVESA_800x600_75hz        = 186,                            /*  800x600  (75 Hz) SVGA timing.*/
  123.     timingVESA_1024x768_60hz    = 190,                            /* 1024x768  (60 Hz) VESA 1K-60Hz timing.*/
  124.     timingVESA_1024x768_70hz    = 200,                            /* 1024x768  (70 Hz) VESA 1K-70Hz timing.*/
  125.     timingVESA_1024x768_75hz    = 204,                            /* 1024x768  (75 Hz) VESA 1K-70Hz timing (very similar to timingApple_1024x768_75hz).*/
  126.     timingApple_1024x768_75hz    = 210,                            /* 1024x768  (75 Hz) Apple 19" RGB.*/
  127.     timingApple_1152x870_75hz    = 220,                            /* 1152x870  (75 Hz) Apple 21" RGB.*/
  128.     timingAppleNTSC_ST            = 230,                            /*  512x384  (60 Hz, interlaced, non-convolved).*/
  129.     timingAppleNTSC_FF            = 232,                            /*  640x480  (60 Hz, interlaced, non-convolved).*/
  130.     timingAppleNTSC_STconv        = 234,                            /*  512x384  (60 Hz, interlaced, convolved).*/
  131.     timingAppleNTSC_FFconv        = 236,                            /*  640x480  (60 Hz, interlaced, convolved).*/
  132.     timingApplePAL_ST            = 238,                            /*  640x480  (50 Hz, interlaced, non-convolved).*/
  133.     timingApplePAL_FF            = 240,                            /*  768x576  (50 Hz, interlaced, non-convolved).*/
  134.     timingApplePAL_STconv        = 242,                            /*  640x480  (50 Hz, interlaced, convolved).*/
  135.     timingApplePAL_FFconv        = 244,                            /*  768x576  (50 Hz, interlaced, convolved).*/
  136.     timingVESA_1280x960_75hz    = 250,                            /* 1280x960  (75 Hz)*/
  137.     timingVESA_1280x1024_60hz    = 260,                            /* 1280x1024 (60 Hz)*/
  138.     timingVESA_1280x1024_75hz    = 262,                            /* 1280x1024 (75 Hz)*/
  139.     timingVESA_1600x1200_60hz    = 280,                            /* 1600x1200 (60 Hz) VESA proposed timing.*/
  140.     timingVESA_1600x1200_65hz    = 282,                            /* 1600x1200 (65 Hz) VESA proposed timing.*/
  141.     timingVESA_1600x1200_70hz    = 284,                            /* 1600x1200 (70 Hz) VESA proposed timing.*/
  142.     timingVESA_1600x1200_75hz    = 286,                            /* 1600x1200 (75 Hz) VESA proposed timing.*/
  143.     timingVESA_1600x1200_80hz    = 288,                            /* 1600x1200 (80 Hz) VESA proposed timing (pixel clock is 216 Mhz dot clock).*/
  144.     timingSMPTE240M_60hz        = 400,                            /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035.*/
  145.     timingFilmRate_48hz            = 410                            /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480.*/
  146. };
  147.  
  148. /* csConnectFlags values in VDDisplayConnectInfo */
  149.  
  150. enum {
  151.     kAllModesValid                = 0,                            /* All modes not trimmed by primary init are good close enough to try */
  152.     kAllModesSafe                = 1,                            /* All modes not trimmed by primary init are know to be safe */
  153.     kReportsTagging                = 2,                            /* Can detect tagged displays (to identify smart monitors) */
  154.     kHasDirectConnection        = 3,                            /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */
  155.     kIsMonoDev                    = 4,                            /* Says whether there's an RGB (0) or Monochrome (1) connection. */
  156.     kUncertainConnection        = 5,                            /* There may not be a display (no sense lines?). */
  157.     kTaggingInfoNonStandard        = 6,                            /* Set when csConnectTaggedType/csConnectTaggedData are non-standard (i.e., not the Apple CRT sense codes). */
  158.     kReportsDDCConnection        = 7,                            /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */
  159.     kHasDDCConnection            = 8                                /* Card has ddc connect now. */
  160. };
  161.  
  162. /* csDisplayType values in VDDisplayConnectInfo */
  163.  
  164. enum {
  165.     kUnknownConnect                = 1,                            /* Not sure how we'll use this, but seems like a good idea. */
  166.     kPanelConnect                = 2,                            /* For use with fixed-in-place LCD panels. */
  167.     kPanelTFTConnect            = 2,                            /* Alias for kPanelConnect */
  168.     kFixedModeCRTConnect        = 3,                            /*  For use with fixed-mode (i.e., very limited range) displays. */
  169.     kMultiModeCRT1Connect        = 4,                            /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */
  170.     kMultiModeCRT2Connect        = 5,                            /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */
  171.     kMultiModeCRT3Connect        = 6,                            /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */
  172.     kMultiModeCRT4Connect        = 7,                            /* Expansion to large multi mode (not yet used) */
  173.     kModelessConnect            = 8,                            /* Expansion to modeless model (not yet used) */
  174.     kFullPageConnect            = 9,                            /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */
  175.     kVGAConnect                    = 10,                            /* 640x480 VGA default -- question everything else */
  176.     kNTSCConnect                = 11,                            /* NTSC ST (default), FF, STconv, FFconv */
  177.     kPALConnect                    = 12,                            /* PAL ST (default), FF, STconv, FFconv */
  178.     kHRConnect                    = 13,                            /* Straight-6 connect -- 640x480 and 640x400 (to get 8bpp in 256K case) (these two only) */
  179.     kPanelFSTNConnect            = 14,                            /* For use with fixed-in-place LCD FSTN (aka ``Supertwist'') panels */
  180.     kMonoTwoPageConnect            = 15,                            /* 1152x870 Apple color two-page display */
  181.     kColorTwoPageConnect        = 16,                            /* 1152x870 Apple B&W two-page display */
  182.     kColor16Connect                = 17,                            /* 832x624 Apple B&W two-page display */
  183.     kColor19Connect                = 18                            /* 1024x768 Apple B&W two-page display */
  184. };
  185.  
  186. /* csTimingFlags values in VDTimingInfoRec */
  187.  
  188. enum {
  189.     kModeValid                    = 0,                            /* Says that this mode should NOT be trimmed. */
  190.     kModeSafe                    = 1,                            /* This mode does not need confirmation */
  191.     kModeDefault                = 2,                            /* This is the default mode for this type of connection */
  192.     kModeShowNow                = 3,                            /* This mode should always be shown (even though it may require a confirm) */
  193.     kModeNotResize                = 4,                            /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */
  194.     kModeRequiresPan            = 5,                            /* This mode has more pixels than are actually displayed */
  195.     kModeInterlaced                = 6,                            /* This mode is interlaced (single pixel lines look bad). */
  196.     kModeShowNever                = 7                                /* This mode should not be shown in the user interface. */
  197. };
  198.  
  199. /* csResolutionFlags bit flags for VDResolutionInfoRec */
  200.  
  201. enum {
  202.     kResolutionHasMultipleDepthSizes = 0                        /* Says that this mode has different csHorizontalPixels, csVerticalLines at different depths (usually slightly larger at lower depths) */
  203. };
  204.  
  205.  
  206. enum {
  207.                                                                 /*    Power Mode constants for VDPowerStateRec.powerState.    */
  208.     kAVPowerOff                    = 0,
  209.     kAVPowerStandby                = 1,
  210.     kAVPowerSuspend                = 2,
  211.     kAVPowerOn                    = 3
  212. };
  213.  
  214.  
  215. enum {
  216.                                                                 /*    Power Mode masks and bits for VDPowerStateRec.powerFlags.    */
  217.     kPowerStateNeedsRefresh        = 0,
  218.     kPowerStateNeedsRefreshMask    = (1L << 0)
  219. };
  220.  
  221.  
  222. enum {
  223.                                                                 /* Control Codes */
  224.     cscReset                    = 0,
  225.     cscKillIO                    = 1,
  226.     cscSetMode                    = 2,
  227.     cscSetEntries                = 3,
  228.     cscSetGamma                    = 4,
  229.     cscGrayPage                    = 5,
  230.     cscGrayScreen                = 5,
  231.     cscSetGray                    = 6,
  232.     cscSetInterrupt                = 7,
  233.     cscDirectSetEntries            = 8,
  234.     cscSetDefaultMode            = 9,
  235.     cscSwitchMode                = 10,
  236.     cscSetSync                    = 11,
  237.     cscSavePreferredConfiguration = 16,
  238.     cscSetHardwareCursor        = 22,
  239.     cscDrawHardwareCursor        = 23,
  240.     cscSetConvolution            = 24,
  241.     cscSetPowerState            = 25,
  242.     cscPrivateControlCall        = 26,
  243.     cscUnusedCall                = 127                            /* This call used to expend the scrn resource.  Its imbedded data contains more control info */
  244. };
  245.  
  246.  
  247. enum {
  248.                                                                 /* Status Codes */
  249.     cscGetMode                    = 2,
  250.     cscGetEntries                = 3,
  251.     cscGetPageCnt                = 4,
  252.     cscGetPages                    = 4,                            /* This is what C&D 2 calls it. */
  253.     cscGetPageBase                = 5,
  254.     cscGetBaseAddr                = 5,                            /* This is what C&D 2 calls it. */
  255.     cscGetGray                    = 6,
  256.     cscGetInterrupt                = 7,
  257.     cscGetGamma                    = 8,
  258.     cscGetDefaultMode            = 9,
  259.     cscGetCurMode                = 10,
  260.     cscGetSync                    = 11,
  261.     cscGetConnection            = 12,                            /* Return information about the connection to the display */
  262.     cscGetModeTiming            = 13,                            /* Return timing info for a mode */
  263.     cscGetModeBaseAddress        = 14,                            /* Return base address information about a particular mode */
  264.     cscGetScanProc                = 15,                            /* QuickTime scan chasing routine */
  265.     cscGetPreferredConfiguration = 16,
  266.     cscGetNextResolution        = 17,
  267.     cscGetVideoParameters        = 18,
  268.     cscGetGammaInfoList            = 20,
  269.     cscRetrieveGammaTable        = 21,
  270.     cscSupportsHardwareCursor    = 22,
  271.     cscGetHardwareCursorDrawState = 23,
  272.     cscGetConvolution            = 24,
  273.     cscGetPowerState            = 25,
  274.     cscPrivateStatusCall        = 26
  275. };
  276.  
  277. /* Bit definitions for the Get/Set Sync call*/
  278.  
  279. enum {
  280.     kDisableHorizontalSyncBit    = 0,
  281.     kDisableVerticalSyncBit        = 1,
  282.     kDisableCompositeSyncBit    = 2,
  283.     kEnableSyncOnBlue            = 3,
  284.     kEnableSyncOnGreen            = 4,
  285.     kEnableSyncOnRed            = 5,
  286.     kNoSeparateSyncControlBit    = 6,
  287.     kTriStateSyncBit            = 7,
  288.     kHorizontalSyncMask            = 0x01,
  289.     kVerticalSyncMask            = 0x02,
  290.     kCompositeSyncMask            = 0x04,
  291.     kDPMSSyncMask                = 0x07,
  292.     kTriStateSyncMask            = 0x80,
  293.     kSyncOnBlueMask                = 0x08,
  294.     kSyncOnGreenMask            = 0x10,
  295.     kSyncOnRedMask                = 0x20,
  296.     kSyncOnMask                    = 0x38
  297. };
  298.  
  299.  
  300. enum {
  301.                                                                 /*    Power Mode constants for translating DPMS modes to Get/SetSync calls.    */
  302.     kDPMSSyncOn                    = 0,
  303.     kDPMSSyncStandby            = 1,
  304.     kDPMSSyncSuspend            = 2,
  305.     kDPMSSyncOff                = 7
  306. };
  307.  
  308. /* Bit definitions for the Get/Set Convolution call*/
  309.  
  310. enum {
  311.     kConvolved                    = 0,
  312.     kLiveVideoPassThru            = 1,
  313.     kConvolvedMask                = 0x01,
  314.     kLiveVideoPassThruMask        = 0x02
  315. };
  316.  
  317. struct VPBlock {
  318.     long                             vpBaseOffset;                /*Offset to page zero of video RAM (From minorBaseOS).*/
  319.     short                             vpRowBytes;                    /*Width of each row of video memory.*/
  320.     Rect                             vpBounds;                    /*BoundsRect for the video display (gives dimensions).*/
  321.     short                             vpVersion;                    /*PixelMap version number.*/
  322.     short                             vpPackType;
  323.     long                             vpPackSize;
  324.     long                             vpHRes;                        /*Horizontal resolution of the device (pixels per inch).*/
  325.     long                             vpVRes;                        /*Vertical resolution of the device (pixels per inch).*/
  326.     short                             vpPixelType;                /*Defines the pixel type.*/
  327.     short                             vpPixelSize;                /*Number of bits in pixel.*/
  328.     short                             vpCmpCount;                    /*Number of components in pixel.*/
  329.     short                             vpCmpSize;                    /*Number of bits per component*/
  330.     long                             vpPlaneBytes;                /*Offset from one plane to the next.*/
  331. };
  332. typedef struct VPBlock VPBlock;
  333.  
  334. typedef VPBlock *VPBlockPtr;
  335. struct VDEntryRecord {
  336.     Ptr                             csTable;                    /*(long) pointer to color table entry=value, r,g,b:INTEGER*/
  337. };
  338. typedef struct VDEntryRecord VDEntryRecord;
  339.  
  340. typedef VDEntryRecord *VDEntRecPtr;
  341. /* Parm block for SetGray control call */
  342. struct VDGrayRecord {
  343.     Boolean                         csMode;                        /*Same as GDDevType value (0=color, 1=mono)*/
  344.     SInt8                             filler;
  345. };
  346. typedef struct VDGrayRecord VDGrayRecord;
  347.  
  348. typedef VDGrayRecord *VDGrayPtr;
  349. /* Parm block for SetInterrupt call */
  350. struct VDFlagRecord {
  351.     SInt8                             csMode;
  352.     SInt8                             filler;
  353. };
  354. typedef struct VDFlagRecord VDFlagRecord;
  355.  
  356. typedef VDFlagRecord *VDFlagRecPtr;
  357. /* Parm block for SetEntries control call */
  358. struct VDSetEntryRecord {
  359.     ColorSpec *                        csTable;                    /*Pointer to an array of color specs*/
  360.     short                             csStart;                    /*Which spec in array to start with, or -1*/
  361.     short                             csCount;                    /*Number of color spec entries to set*/
  362. };
  363. typedef struct VDSetEntryRecord VDSetEntryRecord;
  364.  
  365. typedef VDSetEntryRecord *VDSetEntryPtr;
  366. /* Parm block for SetGamma control call */
  367. struct VDGammaRecord {
  368.     Ptr                             csGTable;                    /*pointer to gamma table*/
  369. };
  370. typedef struct VDGammaRecord VDGammaRecord;
  371.  
  372. typedef VDGammaRecord *VDGamRecPtr;
  373. struct VDBaseAddressInfoRec {
  374.     long                             csDevData;                    /* LONGINT - (long) timing mode */
  375.     long                             csDevBase;                    /* LONGINT - (long) base address of the mode */
  376.     short                             csModeReserved;                /* INTEGER - (short) will some day be the depth */
  377.     long                             csModeBase;                    /* LONGINT - (long) reserved */
  378. };
  379. typedef struct VDBaseAddressInfoRec VDBaseAddressInfoRec;
  380.  
  381. typedef VDBaseAddressInfoRec *VDBaseAddressInfoPtr;
  382. struct VDSwitchInfoRec {
  383.     unsigned short                     csMode;                        /*(word) mode depth*/
  384.     unsigned long                     csData;                        /*(long) functional sResource of mode*/
  385.     unsigned short                     csPage;                        /*(word) page to switch in*/
  386.     Ptr                             csBaseAddr;                    /*(long) base address of page (return value)*/
  387.     unsigned long                     csReserved;                    /*(long) Reserved (set to 0) */
  388. };
  389. typedef struct VDSwitchInfoRec VDSwitchInfoRec;
  390.  
  391. typedef VDSwitchInfoRec *VDSwitchInfoPtr;
  392. struct VDTimingInfoRec {
  393.     unsigned long                     csTimingMode;                /* LONGINT - (long) timing mode (a la InitGDevice) */
  394.     unsigned long                     csTimingReserved;            /* LONGINT - (long) reserved */
  395.     unsigned long                     csTimingFormat;                /* LONGINT - (long) what format is the timing info */
  396.     unsigned long                     csTimingData;                /* LONGINT - (long) data supplied by driver */
  397.     unsigned long                     csTimingFlags;                /* LONGINT - (long) mode within device */
  398. };
  399. typedef struct VDTimingInfoRec VDTimingInfoRec;
  400.  
  401. typedef VDTimingInfoRec *VDTimingInfoPtr;
  402. struct VDDisplayConnectInfoRec {
  403.     unsigned short                     csDisplayType;                /* INTEGER - (word) Type of display connected */
  404.     unsigned char                     csConnectTaggedType;        /* BYTE - type of tagging */
  405.     unsigned char                     csConnectTaggedData;        /* BYTE - tagging data */
  406.     unsigned long                     csConnectFlags;                /* LONGINT - (long) tell us about the connection */
  407.     unsigned long                     csDisplayComponent;            /* LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) */
  408.     unsigned long                     csConnectReserved;            /* LONGINT - (long) reserved */
  409. };
  410. typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec;
  411.  
  412. typedef VDDisplayConnectInfoRec *VDDisplayConnectInfoPtr;
  413. /*
  414.  RawSenseCode
  415.     This abstract data type is not exactly abstract.  Rather, it is merely enumerated constants
  416.     for the possible raw sense code values when 'standard' sense code hardware is implemented.
  417.  
  418.     For 'standard' sense code hardware, the raw sense is obtained as follows:
  419.         * Instruct the frame buffer controller NOT to actively drive any of the monitor sense lines
  420.         * Read the state of the monitor sense lines 2, 1, and 0.  (2 is the MSB, 0 the LSB)
  421.  
  422.     IMPORTANT Note: 
  423.     When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants 
  424.     are valid 'csConnectTaggedType' values in 'VDDisplayConnectInfo' 
  425.  
  426. */
  427. typedef unsigned char RawSenseCode;
  428.  
  429. enum {
  430.     kRSCZero                    = 0,
  431.     kRSCOne                        = 1,
  432.     kRSCTwo                        = 2,
  433.     kRSCThree                    = 3,
  434.     kRSCFour                    = 4,
  435.     kRSCFive                    = 5,
  436.     kRSCSix                        = 6,
  437.     kRSCSeven                    = 7
  438. };
  439.  
  440. /*
  441.  ExtendedSenseCode
  442.     This abstract data type is not exactly abstract.  Rather, it is merely enumerated constants
  443.     for the values which are possible when the extended sense algorithm is applied to hardware
  444.     which implements 'standard' sense code hardware.
  445.  
  446.      For 'standard' sense code hardware, the extended sense code algorithm is as follows:
  447.     (Note:  as described here, sense line 'A' corresponds to '2', 'B' to '1', and 'C' to '0')
  448.         * Drive sense line 'A' low and read the values of 'B' and 'C'.  
  449.         * Drive sense line 'B' low and read the values of 'A' and 'C'.
  450.         * Drive sense line 'C' low and read the values of 'A' and 'B'.
  451.  
  452.     In this way, a six-bit number of the form BC/AC/AB is generated. 
  453.  
  454.     IMPORTANT Note: 
  455.     When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants 
  456.     are valid 'csConnectTaggedData' values in 'VDDisplayConnectInfo' 
  457.  
  458. */
  459. typedef unsigned char ExtendedSenseCode;
  460.  
  461. enum {
  462.     kESCZero21Inch                = 0x00,                            /* 21" RGB                                 */
  463.     kESCOnePortraitMono            = 0x14,                            /* Portrait Monochrome                     */
  464.     kESCTwo12Inch                = 0x21,                            /* 12" RGB                                */
  465.     kESCThree21InchRadius        = 0x31,                            /* 21" RGB (Radius)                        */
  466.     kESCThree21InchMonoRadius    = 0x34,                            /* 21" Monochrome (Radius)                 */
  467.     kESCThree21InchMono            = 0x35,                            /* 21" Monochrome                        */
  468.     kESCFourNTSC                = 0x0A,                            /* NTSC                                 */
  469.     kESCFivePortrait            = 0x1E,                            /* Portrait RGB                         */
  470.     kESCSixMSB1                    = 0x03,                            /* MultiScan Band-1 (12" thru 1Six")    */
  471.     kESCSixMSB2                    = 0x0B,                            /* MultiScan Band-2 (13" thru 19")        */
  472.     kESCSixMSB3                    = 0x23,                            /* MultiScan Band-3 (13" thru 21")        */
  473.     kESCSixStandard                = 0x2B,                            /* 13"/14" RGB or 12" Monochrome        */
  474.     kESCSevenPAL                = 0x00,                            /* PAL                                    */
  475.     kESCSevenNTSC                = 0x14,                            /* NTSC                                 */
  476.     kESCSevenVGA                = 0x17,                            /* VGA                                     */
  477.     kESCSeven16Inch                = 0x2D,                            /* 16" RGB (GoldFish)                      */
  478.     kESCSevenPALAlternate        = 0x30,                            /* PAL (Alternate)                         */
  479.     kESCSeven19Inch                = 0x3A,                            /* Third-Party 19''                        */
  480.     kESCSevenNoDisplay            = 0x3F                            /* No display connected                 */
  481. };
  482.  
  483. /*
  484.  DepthMode
  485.     This abstract data type is used to to reference RELATIVE pixel depths.
  486.     Its definition is largely derived from its past usage, analogous to 'xxxVidMode'
  487.  
  488.     Bits per pixel DOES NOT directly map to 'DepthMode'  For example, on some
  489.     graphics hardware, 'kDepthMode1' may represent 1 BPP, whereas on other
  490.     hardware, 'kDepthMode1' may represent 8BPP.
  491.  
  492.     DepthMode IS considered to be ordinal, i.e., operations such as <, >, ==, etc.
  493.     behave as expected.  The values of the constants which comprise the set are such
  494.     that 'kDepthMode4 < kDepthMode6' behaves as expected.
  495. */
  496. typedef unsigned short DepthMode;
  497.  
  498. enum {
  499.     kDepthMode1                    = 128,
  500.     kDepthMode2                    = 129,
  501.     kDepthMode3                    = 130,
  502.     kDepthMode4                    = 131,
  503.     kDepthMode5                    = 132,
  504.     kDepthMode6                    = 133
  505. };
  506.  
  507.  
  508. enum {
  509.     kFirstDepthMode                = 128,                            /* These constants are obsolete, and just included    */
  510.     kSecondDepthMode            = 129,                            /* for clients that have converted to the above        */
  511.     kThirdDepthMode                = 130,                            /* kDepthModeXXX constants.                            */
  512.     kFourthDepthMode            = 131,
  513.     kFifthDepthMode                = 132,
  514.     kSixthDepthMode                = 133
  515. };
  516.  
  517. struct VDPageInfo {
  518.     short                             csMode;                        /*(word) mode within device*/
  519.     long                             csData;                        /*(long) data supplied by driver*/
  520.     short                             csPage;                        /*(word) page to switch in*/
  521.     Ptr                             csBaseAddr;                    /*(long) base address of page*/
  522. };
  523. typedef struct VDPageInfo VDPageInfo;
  524.  
  525. typedef VDPageInfo *VDPgInfoPtr;
  526. struct VDSizeInfo {
  527.     short                             csHSize;                    /*(word) desired/returned h size*/
  528.     short                             csHPos;                        /*(word) desired/returned h position*/
  529.     short                             csVSize;                    /*(word) desired/returned v size*/
  530.     short                             csVPos;                        /*(word) desired/returned v position*/
  531. };
  532. typedef struct VDSizeInfo VDSizeInfo;
  533.  
  534. typedef VDSizeInfo *VDSzInfoPtr;
  535. struct VDSettings {
  536.     short                             csParamCnt;                    /*(word) number of params*/
  537.     short                             csBrightMax;                /*(word) max brightness*/
  538.     short                             csBrightDef;                /*(word) default brightness*/
  539.     short                             csBrightVal;                /*(word) current brightness*/
  540.     short                             csCntrstMax;                /*(word) max contrast*/
  541.     short                             csCntrstDef;                /*(word) default contrast*/
  542.     short                             csCntrstVal;                /*(word) current contrast*/
  543.     short                             csTintMax;                    /*(word) max tint*/
  544.     short                             csTintDef;                    /*(word) default tint*/
  545.     short                             csTintVal;                    /*(word) current tint*/
  546.     short                             csHueMax;                    /*(word) max hue*/
  547.     short                             csHueDef;                    /*(word) default hue*/
  548.     short                             csHueVal;                    /*(word) current hue*/
  549.     short                             csHorizDef;                    /*(word) default horizontal*/
  550.     short                             csHorizVal;                    /*(word) current horizontal*/
  551.     short                             csHorizMax;                    /*(word) max horizontal*/
  552.     short                             csVertDef;                    /*(word) default vertical*/
  553.     short                             csVertVal;                    /*(word) current vertical*/
  554.     short                             csVertMax;                    /*(word) max vertical*/
  555. };
  556. typedef struct VDSettings VDSettings;
  557.  
  558. typedef VDSettings *VDSettingsPtr;
  559. struct VDDefMode {
  560.     UInt8                             csID;
  561.     SInt8                             filler;
  562. };
  563. typedef struct VDDefMode VDDefMode;
  564.  
  565. typedef VDDefMode *VDDefModePtr;
  566. struct VDSyncInfoRec {
  567.     UInt8                             csMode;
  568.     UInt8                             csFlags;
  569. };
  570. typedef struct VDSyncInfoRec VDSyncInfoRec;
  571.  
  572. typedef VDSyncInfoRec *VDSyncInfoPtr;
  573. typedef unsigned long DisplayModeID;
  574. typedef unsigned long VideoDeviceType;
  575. typedef unsigned long GammaTableID;
  576. /* Constants for the GetNextResolution call */
  577.  
  578. enum {
  579.     kDisplayModeIDCurrent        = 0x00,                            /* Reference the Current DisplayModeID */
  580.     kDisplayModeIDInvalid        = 0xFFFFFFFF,                    /* A bogus DisplayModeID in all cases */
  581.     kDisplayModeIDFindFirstResolution = 0xFFFFFFFE,                /* Used in cscGetNextResolution to reset iterator */
  582.     kDisplayModeIDNoMoreResolutions = 0xFFFFFFFD                /* Used in cscGetNextResolution to indicate End Of List */
  583. };
  584.  
  585. /* Constants for the GetGammaInfoList call */
  586.  
  587. enum {
  588.     kGammaTableIDFindFirst        = 0xFFFFFFFE,                    /* Get the first gamma table ID */
  589.     kGammaTableIDNoMoreTables    = 0xFFFFFFFD,                    /* Used to indicate end of list */
  590.     kGammaTableIDSpecific        = 0x00                            /* Return the info for the given table id */
  591. };
  592.  
  593. struct VDResolutionInfoRec {
  594.     DisplayModeID                     csPreviousDisplayModeID;    /* ID of the previous resolution in a chain */
  595.     DisplayModeID                     csDisplayModeID;            /* ID of the next resolution */
  596.     unsigned long                     csHorizontalPixels;            /* # of pixels in a horizontal line at the max depth */
  597.     unsigned long                     csVerticalLines;            /* # of lines in a screen at the max depth */
  598.     Fixed                             csRefreshRate;                /* Vertical Refresh Rate in Hz */
  599.     DepthMode                         csMaxDepthMode;                /* 0x80-based number representing max bit depth */
  600.     unsigned long                     csResolutionFlags;            /* Reserved - flag bits */
  601.     unsigned long                     csReserved;                    /* Reserved */
  602. };
  603. typedef struct VDResolutionInfoRec VDResolutionInfoRec;
  604.  
  605. typedef VDResolutionInfoRec *VDResolutionInfoPtr;
  606. struct VDVideoParametersInfoRec {
  607.     DisplayModeID                     csDisplayModeID;            /* the ID of the resolution we want info on */
  608.     DepthMode                         csDepthMode;                /* The bit depth we want the info on (0x80 based) */
  609.     VPBlockPtr                         csVPBlockPtr;                /* Pointer to a video parameter block */
  610.     unsigned long                     csPageCount;                /* Number of pages supported by the resolution */
  611.     VideoDeviceType                 csDeviceType;                /* Device Type:  Direct, Fixed or CLUT; */
  612.     unsigned long                     csReserved;                    /* Reserved */
  613. };
  614. typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec;
  615.  
  616. typedef VDVideoParametersInfoRec *VDVideoParametersInfoPtr;
  617. struct VDGammaInfoRec {
  618.     GammaTableID                     csLastGammaID;                /* the ID of the previous gamma table */
  619.     GammaTableID                     csNextGammaID;                /* the ID of the next gamma table */
  620.     Ptr                             csGammaPtr;                    /* Ptr to a gamma table data */
  621.     unsigned long                     csReserved;                    /* Reserved */
  622. };
  623. typedef struct VDGammaInfoRec VDGammaInfoRec;
  624.  
  625. typedef VDGammaInfoRec *VDGammaInfoPtr;
  626. struct VDGetGammaListRec {
  627.     GammaTableID                     csPreviousGammaTableID;        /* ID of the previous gamma table */
  628.     GammaTableID                     csGammaTableID;                /* ID of the gamma table following csPreviousDisplayModeID */
  629.     unsigned long                     csGammaTableSize;            /* Size of the gamma table in bytes */
  630.     char *                            csGammaTableName;            /* Gamma table name (c-string) */
  631. };
  632. typedef struct VDGetGammaListRec VDGetGammaListRec;
  633.  
  634. typedef VDGetGammaListRec *VDGetGammaListPtr;
  635. struct VDRetrieveGammaRec {
  636.     GammaTableID                     csGammaTableID;                /* ID of gamma table to retrieve */
  637.     GammaTbl *                        csGammaTablePtr;            /* Location to copy desired gamma to */
  638. };
  639. typedef struct VDRetrieveGammaRec VDRetrieveGammaRec;
  640.  
  641. typedef VDRetrieveGammaRec *VDRetrieveGammaPtr;
  642. struct VDSetHardwareCursorRec {
  643.     void *                            csCursorRef;                /* reference to cursor data */
  644.     UInt32                             csReserved1;                /* reserved for future use */
  645.     UInt32                             csReserved2;                /* should be ignored */
  646. };
  647. typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec;
  648.  
  649. typedef VDSetHardwareCursorRec *VDSetHardwareCursorPtr;
  650. struct VDDrawHardwareCursorRec {
  651.     SInt32                             csCursorX;                    /* x coordinate */
  652.     SInt32                             csCursorY;                    /* y coordinate */
  653.     UInt32                             csCursorVisible;            /* true if cursor is must be visible */
  654.     UInt32                             csReserved1;                /* reserved for future use */
  655.     UInt32                             csReserved2;                /* should be ignored */
  656. };
  657. typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec;
  658.  
  659. typedef VDDrawHardwareCursorRec *VDDrawHardwareCursorPtr;
  660. struct VDSupportsHardwareCursorRec {
  661.     UInt32                             csSupportsHardwareCursor;
  662.                                                                 /* true if hardware cursor is supported */
  663.     UInt32                             csReserved1;                /* reserved for future use */
  664.     UInt32                             csReserved2;                /* must be zero */
  665. };
  666. typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec;
  667.  
  668. typedef VDSupportsHardwareCursorRec *VDSupportsHardwareCursorPtr;
  669. struct VDHardwareCursorDrawStateRec {
  670.     SInt32                             csCursorX;                    /* x coordinate */
  671.     SInt32                             csCursorY;                    /* y coordinate */
  672.     UInt32                             csCursorVisible;            /* true if cursor is visible */
  673.     UInt32                             csCursorSet;                /* true if cursor successfully set by last set control call */
  674.     UInt32                             csReserved1;                /* reserved for future use */
  675.     UInt32                             csReserved2;                /* must be zero */
  676. };
  677. typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec;
  678.  
  679. typedef VDHardwareCursorDrawStateRec *VDHardwareCursorDrawStatePtr;
  680. struct VDConvolutionInfoRec {
  681.     DisplayModeID                     csDisplayModeID;            /* the ID of the resolution we want info on */
  682.     DepthMode                         csDepthMode;                /* The bit depth we want the info on (0x80 based) */
  683.     unsigned long                     csPage;
  684.     UInt32                             csFlags;
  685.     UInt32                             csReserved;
  686. };
  687. typedef struct VDConvolutionInfoRec VDConvolutionInfoRec;
  688.  
  689. typedef VDConvolutionInfoRec *VDConvolutionInfoPtr;
  690. struct VDPowerStateRec {
  691.     unsigned long                     powerState;
  692.     unsigned long                     powerFlags;
  693.  
  694.     unsigned long                     powerReserved1;
  695.     unsigned long                     powerReserved2;
  696. };
  697. typedef struct VDPowerStateRec VDPowerStateRec;
  698.  
  699. typedef VDPowerStateRec *VDPowerStatePtr;
  700. /*
  701.     Private Data to video drivers.
  702.     
  703.     In versions of MacOS with multiple address spaces (System 8), the OS 
  704.     must know the extent of parameters in order to move them between the caller
  705.     and driver.  The old private-selector model for video drivers does not have
  706.     this information so:
  707.     
  708.     For post-7.x Systems private calls should be implemented using the cscPrivateCall
  709. */
  710. struct VDPrivateSelectorDataRec {
  711.     LogicalAddress                     privateParameters;            /* Caller's parameters*/
  712.     ByteCount                         privateParametersSize;        /* Size of data sent from caller to driver*/
  713.     LogicalAddress                     privateResults;                /* Caller's return area. Can be nil, or same as privateParameters.*/
  714.     ByteCount                         privateResultsSize;            /* Size of data driver returns to caller. Can be nil, or same as privateParametersSize.*/
  715. };
  716. typedef struct VDPrivateSelectorDataRec VDPrivateSelectorDataRec;
  717.  
  718. struct VDPrivateSelectorRec {
  719.     UInt32                             reserved;                    /* Reserved (set to 0). */
  720.     VDPrivateSelectorDataRec         data[1];
  721. };
  722. typedef struct VDPrivateSelectorRec VDPrivateSelectorRec;
  723.  
  724.  
  725. #if PRAGMA_ALIGN_SUPPORTED
  726. #pragma options align=reset
  727. #endif
  728.  
  729. #if PRAGMA_IMPORT_SUPPORTED
  730. #pragma import off
  731. #endif
  732.  
  733. #ifdef __cplusplus
  734. }
  735. #endif
  736.  
  737. #endif /* __VIDEO__ */
  738.  
  739.